package com.jiang.daily.Q2942;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

/**
 * @author Jiang
 * @version 1.0
 * @date 2025/05/24 23:33
 */
class Solution {
    public List<Integer> findWordsContaining(String[] words, char x) {
        List<Integer> ans = new ArrayList<>();
        for (int i = 0; i < words.length; i++) {
            if (words[i].contains(String.valueOf(x))) {
                ans.add(i);
            }
        }
        return ans;
//        return IntStream.range(0, words.length)
//                .filter(i -> words[i].contains(String.valueOf(x)))
//                .boxed()
//                .collect(Collectors.toList());
    }
}